<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:s="http://jboss.com/products/seam/taglib"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:rich="http://richfaces.org/rich"
                template="embed/template.xhtml">
                
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <ui:define name="topnav">
            <ui:include src="/embed/menu.xhtml">
                <ui:param name="page" value="home" />
            </ui:include>
   </ui:define> 
   
    <ui:define name="sidebar">
       <!--  <ui:include src="/login/login.xhtml" />-->
   </ui:define>
   <ui:define name="search">   
       <ui:include src="/embed/search.xhtml" />
    </ui:define>
        <ui:define name="body">
          <div class="productbox" >
            <f:subview id="no_order" rendered="#{completedOrder == null}">
                <p>你的订购不能完成!</p>

                <h:form>
                    <s:button view="/home.xhtml" value="继续购物"/>
                </h:form>
            </f:subview>
            
            <f:subview id="orderdetail" rendered="#{completedOrder != null}">
                <h2>#{messages.checkoutCompleteHeader}</h2>
                <h:form>
                    <h:dataTable value="#{completedOrder.orderitems}" 
                                 var="item"
                                 styleClass="dvdtable" 
                                 headerClass="dvdtablehead"
                                 rowClasses="dvdtableodd,dvdtableeven"
                                 columnClasses="dvdtablecol">
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="#{messages.cartColorColumn}" />
                            </f:facet>
                            <h:outputText value="#{item.product.color}" />
                        </h:column>                        
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="#{messages.cartSizeColumn}" />
                            </f:facet>
                            <h:outputText value="#{item.product.size}" />
                        </h:column>                        
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="#{messages.cartPriceColumn}" />
                            </f:facet>
                            <h:outputText value="#{item.product.price}">
                                <f:convertNumber type="currency" currencySymbol="￥"/>
                            </h:outputText>
                        </h:column>                                          
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="#{messages.cartQuantityColumn}" />
                            </f:facet>
                            <h:outputText value="#{item.itemNumber}">
                               
                            </h:outputText>
                        </h:column>                        
                    </h:dataTable>
                </h:form>
                

                <div style="width: 30%;">
                    <div class="cntInfo" style="float: none;">
                        <h:panelGrid columns="2">
                            <h:outputText value="#{messages.checkoutSubtotal}" />
                            <h:outputText value="#{completedOrder.totalprice}">
                                <f:convertNumber type="currency" currencySymbol="￥" />
                            </h:outputText>                                                     
                        </h:panelGrid>
                    </div>
                    
                    <div style="float:clear">&#160;</div>
                </div>
                
                <div style="float:none">
                <p class="orderBox cntAlert">
                    谢谢您的订购.  您的消费金额为： 
                    <h:outputText value="#{completedOrder.totalprice + currentOrder.sentprice}"> 
                        <f:convertNumber type="currency" currencySymbol="￥" />
                    </h:outputText>.
                    <h:outputLabel>（其中包含运费：</h:outputLabel>
                    <h:outputText value="#{currentOrder.sentprice}"/>
				    <h:outputLabel>元）</h:outputLabel
				    >
				    <br />
                 <!--charged was to your <h:outputText value="#{completedOrder.customer.customerName}" />.-->
                    您的订单号为：
                    <h:outputText value="#{completedOrder.orderId}" />.
                </p>
                </div>
            </f:subview>
            </div>
        </ui:define>
    </ui:composition>

